package com.td.core.obj.utils;

import java.io.Serializable;


public class TDTimer2 implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	long actTime;
	long maxTime;
	
	public TDTimer2(long time) {
		maxTime = time;
		restart();
	}
	
	public boolean update() {
		if(actTime >= maxTime) {
			restart();
			return true;
		}
		actTime++;
		return false;
	}
	
	public void restart() {
		actTime = 0;
	}
}